<?php


namespace App\Http\observer;




use App\Models\Custom;
use App\Models\CustomThrough;

class CustomThroughObserve
{
    public function saved(CustomThrough $customThrough)
    {
        $custom=Custom::where('id',$customThrough["aid"])->first();
        if (!$custom["through"]){
            Custom::where("id",$custom["id"])->update(["through"=>1]);
        }else{
            Custom::where("id",$custom["id"])->increment("through",1);
        }
    }
}
